var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
const PORT = '8083'; //development port
var config = require("./webpack.config.js");
config.entry.app.unshift(
    //remove hot refresh 1. 2.
    //1. "webpack-dev-server/client?http://localhost:" + PORT + "/", //automatic refresh
    //2. "webpack/hot/dev-server"//hot module replacement
);
var compiler = webpack(config);
var server = new WebpackDevServer(compiler, {
    hot: true, //hot module replacement
    // contentBase: 'build/',
    historyApiFallback: true,
    // Set this as true if you want to access dev server from arbitrary url.
    // This is handy if you are using a html5 router.
    proxy: {
        '/api/*': {
            // target: 'http://amdox.software',
            // target: 'http://eap.amdox.net',
            // target: 'http://192.168.1.119:9090',
            target: 'http://192.168.1.110:8082',
            // target: 'http://localhost:3001',
            pathRewrite: {'^/api': ''},
            secure: false,
            // changeOrigin: true
        }
    },
    clientLogLevel: "info",
    // Control the console log messages shown in the browser when using inline mode.
    // Can be `error`, `warning`, `info` or `none`.
    // compress: true,
    // Set this if you want to enable gzip compression for assets


});
server.listen(PORT, function () {
    // console.log(eror)
    // console.log(result)
});